package com.example.demo.thread;

public class MyObject {

    public synchronized void methodA() {
        System.out.println("A is calling...");
    }

    public synchronized void methodB() {
        System.out.println("B is calling...");
        if(Boolean.TRUE) {
            while(true) {
                try {
                    Thread.sleep(1000);
                } catch (InterruptedException e) {
                }
                System.out.println("B is processing...");
            }
        }


    }
}
